package com.lzh.mybatisdemo.dao;


import com.lzh.mybatisdemo.entity.SysRole;
import com.lzh.mybatisdemo.entity.SysUser;

import java.util.List;

public interface SysUserDao {
    int deleteByPrimaryKey(Long id);

    /**
     * 新增用户
     *
     * @param record
     * @return
     */
    int insert(SysUser record);

    /**
     * 新增用户 使用selectKey返回主键的值
     *
     * @param record
     * @return
     */
    int insert2(SysUser record);

    /**
     * 根据主键更新
     *
     * @param sysUser
     * @return
     */
    int updateById(SysUser sysUser);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKeyWithBLOBs(SysUser record);

    int updateByPrimaryKey(SysUser record);

    SysUser selectById(Long id);

    List<SysUser> selectAll();

    /**
     * 根据用户id获取用户角色
     *
     * @param userId
     * @return
     */
    List<SysRole> selectRolesByUserId(Long userId);

}